<div style="height:500px;width:900px;overflow-y:auto;overflow-x:hidden;">
    <div class="clearfix ng-scope ml10">
        <div>
            <button class="btn"
                    ui-dialog="引入待录入回款"
                    ui-dialog-data="contractBaseInfo"
                    ui-dialog-show="onRefundImportNoInvoiceShow($dialogScope, 2, $dialog)"
                    ui-dialog-ok="importPayment($dialogScope.selectedItem)"
                    ui-dialog-cache="false"
                    ng-disabled="data.edit"
                    ui-dialog-url="/contract/editinc/import-unrecord_refund.html">引入待录入回款
            </button>
        </div>
    </div>
    <form name="editRefundForm" class="form-horizontal" novalidate>
        <div class="form-group mt10 clearfix">
            <span class="col-sm-4 control-label">财务编号</span>

            <div class="col-sm-8" ng-if="!data.edit">
                <input type="text" ng-model="refundInfo.finance_code" ng-disabled="true" class="form-control"
                       id="inputPrice"
                       placeholder="财务编号"
                       required name="finance_code">
                <span role="alert"
                      ng-show="(editRefundForm.$submitted || editRefundForm.finance_code.$touched) && editRefundForm.finance_code.$error.required"
                      class="error ng-hide c-red lh30">财务编号不能为空</span>
            </div>
            <div class="col-sm-8" ng-if="data.edit">
                <input class="form-control" type="text" placeholder="财务编号" ng-disabled="true"
                       ng-value="info.finance_code">
            </div>

            <span class="col-sm-4 control-label">登记时间</span>

            <div class="col-sm-8" ng-if="!data.edit">
                <input type="text" class="input-date fl form-control" ng-disabled="true" style="width:100%"
                       ng-model="refundInfo.register_date" placeholder="登记时间">
            </div>
            <div class="col-sm-8" ng-if="data.edit">
                <input type="text" class="input-date fl form-control" ng-disabled="true" style="width:100%"
                       placeholder="登记时间"
                       ng-value="info.register_date|strdate:'yyyy-MM-dd hh:mm:ss'">
            </div>
        </div>
        <div class="form-group mt10 clearfix">
            <span class="col-sm-4 control-label">支付金额</span>

            <div class="col-sm-8" ng-if="!data.edit">
                <input type="number" ng-model="refundInfo.payment_amount" max="{{maxPayment}}" class="form-control"
                       id="inputPrice"
                       placeholder="实收金额"
                       required number name="payment_amount">
                <span role="alert"
                      ng-show="(editRefundForm.$submitted || editRefundForm.payment_amount.$touched) && editRefundForm.payment_amount.$error.required"
                      class="error ng-hide c-red lh30">实收金额不能为空</span>
                <span role="alert"
                      ng-show="(editRefundForm.$submitted || editRefundForm.payment_amount.$touched) && editRefundForm.payment_amount.$error.number"
                      class="error ng-hide c-red lh30">实收金额必须为数值类型</span>
                <span role="alert"
                      ng-show="(editRefundForm.$submitted || editRefundForm.payment_amount.$touched) && editRefundForm.payment_amount.$error.max"
                      class="error ng-hide c-red lh30">实收金额不能超过 {{maxPayment}}</span>
            </div>
            <div class="col-sm-8" ng-if="data.edit">
                <input class="form-control" type="number" placeholder="实收金额" ng-disabled="true"
                       ng-value="info.payment_amount">
            </div>

            <span class="col-sm-4 control-label">实收时间</span>

            <div class="col-sm-8" ng-if="!data.edit">
                <input type="text" class="input-date fl form-control" ng-disabled="true" style="width:100%"
                       ui-date format="yyyy-MM-dd" ng-model="refundInfo.payment_date" placeholder="实收时间">
            </div>
            <div class="col-sm-8" ng-if="data.edit">
                <input type="text" class="input-date fl form-control" ng-disabled="true" style="width:100%"
                       placeholder="实收时间"
                       ng-value="info.payment_date|strdate:'yyyy-MM-dd'">
            </div>
        </div>
        <div class="form-group mt10 clearfix" ng-if="[4,5,6,7].indexOf(busnisseType)>=0">
            <span class="col-sm-4 control-label">支付方式</span>

            <div class="col-sm-8" ng-if="!data.edit">
                <div class="radio fl">
                    <input type="radio" ng-model="refundInfo.pay_way" required value="微信" id="rbt_add"
                           name="pay_way" checked="checked">
                    <label for="rbt_add">微信</label>
                </div>
                <div class="radio fl" style="margin:0 0 0 10px;">
                    <input type="radio" ng-model="refundInfo.pay_way" required value="支付宝" id="rbt_zfb"
                           name="pay_way">
                    <label for="rbt_zfb">支付宝</label>
                </div>
                <div class="radio fl" style="margin:0 0 0 10px;">
                    <input type="radio" ng-model="refundInfo.pay_way" required value="对公" id="rbt_dg"
                           name="pay_way">
                    <label for="rbt_dg">对公</label>
                </div>
                    <span role="alert" style="clear:both;"
                          ng-show="(editRefundForm.$submitted || editRefundForm.pay_way.$touched) && editRefundForm.pay_way.$error.required"
                          class="clearfix error ng-hide c-red lh30">请选择支付方式</span>
            </div>
            <div class="col-sm-8" ng-if="data.edit">
                <div class="radio fl">
                    <input type="radio" ng-model="info.pay_way" required value="微信" id="rbt_add"
                           name="pay_way" checked="checked">
                    <label for="rbt_add">微信</label>
                </div>
                <div class="radio fl" style="margin:0 0 0 10px;">
                    <input type="radio" ng-model="info.pay_way" required value="支付宝" id="rbt_zfb"
                           name="pay_way">
                    <label for="rbt_zfb">支付宝</label>
                </div>
                <div class="radio fl" style="margin:0 0 0 10px;">
                    <input type="radio" ng-model="info.pay_way" required value="对公" id="rbt_dg"
                           name="pay_way">
                    <label for="rbt_dg">对公</label>
                </div>
                <span role="alert" style="clear:both;"
                      ng-show="(editRefundForm.$submitted || editRefundForm.pay_way.$touched) && editRefundForm.pay_way.$error.required"
                      class="clearfix error ng-hide c-red lh30">请选择支付方式</span>
            </div>
        </div>
        <div class="form-group mt10 clearfix">
            <span class="col-sm-4 control-label">实收款编号</span>

            <div class="col-sm-8">
                <input type="text" ng-model="refundInfo.payment_code" ng-disabled="true" class="form-control"
                       id="paymentcode"
                       ng-if="!data.edit"
                       placeholder="实收款编号"
                       name="payment_code"
                       ng-value="info.payment_code">
                <input type="text" ng-value="refundInfo.payment_code" ng-disabled="true" class="form-control"
                       ng-if="data.edit"
                       name="payment_code"
                       ng-value="info.payment_code">
            </div>

            <span class="col-sm-4 control-label">收款账户</span>

            <div class="col-sm-8" ng-if="!data.edit">
                <input type="text" ng-model="refundInfo.receivables_account_name" ng-disabled="true"
                       class="form-control"
                       id="inputPrice"
                       placeholder="收款账户"
                       required name="receivables_account">
                <span role="alert"
                      ng-show="(editRefundForm.$submitted || editRefundForm.receivables_account.$touched) && editRefundForm.receivables_account.$error.required"
                      class="error ng-hide c-red lh30">收款账户不能为空</span>
            </div>
            <div class="col-sm-8" ng-if="data.edit">
                <input type="text" ng-disabled="true" class="form-control" placeholder="收款账户"
                       ng-value="info.receivables_account_name">
            </div>
        </div>
        <div class="form-group mt10 clearfix">
            <span class="col-sm-4 control-label">付款账号名称</span>

            <div class="col-sm-8" ng-if="!data.edit">
                <input type="text" ng-model="refundInfo.payment_account_name" ng-disabled="true"
                       class="form-control" id="inputPrice"
                       placeholder="付款账号名称"
                       required name="payment_account_name">
                <span role="alert"
                      ng-show="(editRefundForm.$submitted || editRefundForm.payment_account_name.$touched) && editRefundForm.payment_account_name.$error.required"
                      class="error ng-hide c-red lh30">付款账号名称不能为空</span>
            </div>
            <div class="col-sm-8" ng-if="data.edit">
                <input type="text" ng-disabled="true" class="form-control" placeholder="付款账号名称"
                       ng-value="info.payment_account_name">
            </div>

            <span class="col-sm-4 control-label">款项归档时间</span>

            <div class="col-sm-8" ng-if="!data.edit">
                <input type="text" class="input-date fl form-control"
                       style="width:100%"
                       placeholder="实收时间"
                       ui-date
                       format="yyyy-MM-dd"
                       ng-model="refundInfo.input_date">
                <span role="alert" class="error ng-hide c-red lh30"
                      ng-show="refundInfo.payment_date.substring(0,10) > refundInfo.input_date">
                    归档时间不能小于实收时间
                </span>
            </div>
            <div class="col-sm-8" ng-if="data.edit">
                <input type="text" ng-disabled="false" class="form-control"
                       style="width:100%"
                       placeholder="款项归档时间"
                       ui-date
                       format="yyyy-MM-dd"
                       ng-model="info.input_date">
            </div>
        </div>

        <div class="form-group mt10 clearfix">
            <span class="col-sm-4 control-label">备注</span>

            <div class="col-sm-20" ng-if="!data.edit">
                <textarea type="text" ng-model="refundInfo.remark" class="form-control"
                          id="inputPrice"
                          placeholder="备注" rows="4"></textarea>
            </div>
            <div class="col-sm-20" ng-if="data.edit">
                <textarea type="text" ng-disabled="false" ng-model="info.remark" class="form-control" rows="4"></textarea>
            </div>
        </div>

    </form>

    <div ng-if="busnisseType != 6">
        <div class="mt20 clearfix ng-scope ml10">
            <span class="fl lh30 f14">发票信息</span>
        </div>
        <div id="grid" class="table-wrap mt10 ml10" style="min-height: 200px;">

            <table width="100%">
                <thead>
                <tr>
                    <th width="30"></th>
                    <th width="40">序号</th>
                    <th>发票信息</th>
                    <th width="170">开票信息</th>
                    <th width="175">款项名称</th>
                    <th width="120">回款金额信息</th>
                    <th width="108">已关联回款</th>
                    <th width="108">备注</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="record in editInvoicePayments">
                    <td class="align-m">
                        <input type="checkbox"
                               ng-model="record._checked"
                               ng-change="shareAmount()"
                               ng-if="(record.cur_billing_amount-record.total_payment > 0) && !data.edit">
                    </td>
                    <td height="40"><p ng-bind="$index + 1"></p></td>
                    <td class="lh14">
                        <p ng-bind="record.invoice_no"></p>

                        <p class="c-gray">客户名称:{{record.customer_name}}</p>
                    </td>
                    <td>
                        <p>开票金额:{{record.invoice_amount|number:2}}</p>

                        <p>已开票金额:{{record.cur_billing_amount|number:2}}</p>

                        <p class="c-gray">开票日期:{{record.invoice_date|strdate:'yyyy-MM-dd'}}</p>
                    </td>
                    <td>
                        <p ng-bind="record.receivable_item_name"></p>
                    </td>
                    <td>
                        <p>已回款金额:{{record.total_payment|number:2}}</p>

                        <p class="c-gray">待回款金额:{{record.cur_billing_amount-record.total_payment|number:2}}</p>

                        <p class="c-gray">本次回款金额:{{record.cur_payment_amount|number:2}}</p>
                    </td>
                    <td>
                        <p ng-bind="record.finance_code"></p>
                    </td>

                    <td>
                        <p ng-bind="record.remark"></p>
                    </td>
                </tr>
                </tbody>
            </table>
            <div class="no-data" ng-if="funds.length == 0" style="height:180px"><span>暂无数据</span></div>
        </div>
    </div>
</div>